package com.Service.impl;

import com.Service.CategoryService;
import com.mapper.CategoryMapper;
import com.pojo.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public List<Category> findAll() {
        return categoryMapper.findAll();
    }

    @Override
    public void add(Category category) {
         categoryMapper.insert(category);
    }

    @Override
    public Category findById(Long id) {
        return categoryMapper.selectById(id);
    }

    @Override
    public void update(Category category) {
         categoryMapper.update(category);
    }

    @Override
    public void delete(Long id) {
         categoryMapper.delete(id);
    }
}
